<?php         
$db = new Database;
$auth = Auth::getAuth('current_user');
$user_id = $auth['id'];
$company_id = $auth['company_id'];
?>
    <div class="drag" style="position: fixed;left: 0;bottom: 0;top:0;z-index:1000;margin-top:2px;margin: 32px 0px 0px 0px;border-right: 1px solid #ddd; width: 30px; min-height: 100%;background-color: #fff;">
        <?php
        $userAvatarMessage = $db->query("SELECT * FROM tbuser WHERE online='1' and id!='$user_id' and company_id ='$company_id'","array");
        foreach($userAvatarMessage as $imageData){
            $name = $imageData['firstname'].'-'.$imageData['lastname'];
            echo "<a href=\"javascript:void(0)\" onclick=\"javascript:chatWith('".$imageData['firstname']."')\">";
            //echo "<a class='openChat'>";
        echo myAvatar($imageData['extension'],$imageData['id'],"30","30","border:1px solid #ddd;");
            echo "</a>";
            //echo '</a>';
        }
        ?>
    </div>
    <div class="body_contents">
        <!-- Edit User Information -->
        <div class="titleBar">
            <div class="left">
               <div class="titlePosition">
                    <div style="float: left;margin-top: 2px;">Edit User Information</div>
               </div>
            </div>
            <div class="right align_right">
            </div>
         </div>
        <div class="Holdercontent">
            <div class="top">
                <div style="float: left;width: 30%;padding: 5px;">   
                    <span class="fontGray">Basic Information</span>
                    <div class="pull-right cursor">
                        <li class="icon-pencil showEditInfo" title="Edit Basic Information"></li>
                        <li class="icon-remove display showCancelEdit" title="Cancel Editing" style="list-style: none"></li>
                    </div>
                    <div class="hr"></div>
                    <form class="basicInformation" method="POST">
                        <div class="fields">
                            <div class="label fontBlack" id="labelObject">Firstname:</div>
                            <div class="input_position">
                                <label class="label fontGray hidebasicInfo lbluserFname" id="labelObject"><?php echo $auth['firstname'];?></label>
                                <input type="text" class="input-x-medium display basicInfo" name="userFname" id="userFname" value="<?php echo $auth['firstname'];?>" style="width:150px;">
                            </div>
                        </div>
                        <div class="fields">
                            <div class="label fontBlack" id="labelObject">Middlename:</div>
                            <div class="input_position">
                                <label class="label fontGray hidebasicInfo lbluMiddlename" id="labelObject"><?php echo $auth['middlename'];?></label>
                                <input type="text" class="input-x-medium display basicInfo" name="uMiddlename" id="uMiddlename" value="<?php echo $auth['middlename'];?>" style="width:150px;">
                            </div>
                        </div>
                        <div class="fields">
                            <div class="label fontBlack" id="labelObject">Lastname:</div>
                            <div class="input_position">
                                <label class="label fontGray hidebasicInfo lbluLastname" id="labelObject" style="width: 100%;"><?php echo $auth['lastname'];?></label>
                                <input type="text" class="input-x-medium display basicInfo" name="uLastname" id="uLastname" value="<?php echo $auth['lastname'];?>" style="width:150px;">
                            </div>
                        </div>
                        <div class="fields">
                            <div class="label fontBlack" id="labelObject">Email:</div>
                            <div class="input_position">
                                <label class="label fontGray hidebasicInfo lbluEmail" id="labelObject"><?php echo $auth['email'];?></label>
                                <input type="text" class="input-x-medium display basicInfo" name="uEmail" id="uEmail" value="<?php echo $auth['email'];?>" style="width:150px;">
                            </div>
                        </div>
                        <?php
                        if($auth['userlevel_id']=="1"){
                        ?>
                        <div class="fields">
                            <div class="label fontBlack" id="labelObject">Code:</div>
                            <div class="input_position">
                                <?php
                                    $company = $db->query("SELECT * FROM tbcompany WHERE id='$company_id'","row");
                                ?>
                                <label class="label fontGray hidebasicInfo lbluCode" id="labelObject"><?php echo $company['company_code'];?></label>
                                <input type="text" class="input-x-medium display basicInfo" name="uCode" id="uCode" value="<?php echo $company['company_code'];?>" style="width:150px;">
                            </div>
                        </div>
                        <?php } ?>
                        <div class="fields" style="margin-top:5px;border-bottom: none;">
                            <div class="label fontBlack" id="labelObject"></div>
                            <div class="input_position">
                                <input type="button" class="button-medium editBasicInfo display" value="Update">
                            </div>
                        </div>
                    </form>
                </div>
                <div style="float: left;width: 33%;border-left:1px solid #ddd;border-right:1px solid #ddd;padding: 5px;min-height: 300px; ">   
                    <span class="fontGray">Change your username</span>
                    <div class="hr"></div>
                    <div class="fields">
                        <div class="label fontBlack" id="labelObject">Username:</div>
                        <div class="input_position">
                            <input type="text" class="input-x-medium oldUsername " value="<?php echo $auth['username'];?>" disabled="disabled" style="width:150px;">
                        </div>
                    </div>
                    <div class="fields">
                        <div class="label fontBlack" id="labelObject">New Username:</div>
                        <div class="input_position">
                            <input type="text" class="input-x-medium newUsername" value="" style="width:150px;">
                        </div>
                    </div>
                    <div class="fields" style="margin-top:5px;border-bottom: none;">
                        <div class="label fontBlack" id="labelObject"></div>
                        <div class="input_position">
                            <input type="button" class="button-medium updateUsername" value="Update">
                        </div>
                    </div>
                </div>
                <div style="float: left;width: 33%;padding: 5px;">   
                    <span class="fontGray">Change your password</span>
                    <div class="hr"></div>
                    <div class="fields">
                        <div class="label fontBlack" id="labelObject">Current:</div>
                        <div class="input_position">
                            <input type="password" class="input-x-medium oldPassword" id="oldPassword" value="" style="width:150px;">
                        </div>
                    </div>
                    <div class="fields">
                        <div class="label fontBlack" id="labelObject">New:</div>
                        <div class="input_position">
                            <input type="password" class="input-x-medium newPassword" id="newPassword" value="" style="width:150px;">
                        </div>
                    </div>
                    <div class="fields">
                        <div class="label fontBlack" id="labelObject">Re-type New:</div>
                        <div class="input_position">
                            <input type="password" class="input-x-medium ReTypePassword" id="retypePassword" value="" style="width:150px;">
                        </div>
                    </div>
                    <div class="fields" style="margin-top:5px;border-bottom: none;">
                        <div class="label fontBlack" id="labelObject"></div>
                        <div class="input_position">
                            <input type="button" class="button-medium updatePassword" value="Update">
                        </div>
                    </div>
                </div>
            </div>
            <div class="down">
               
            </div>
        </div>
    </div>